package com.niiwoo.civet.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.NoSuchElementException;

/**
 * 费用明细枚举
 * Created by wangjichao on 2018/4/20.
 */
@Getter
@AllArgsConstructor
public enum FeeTypeEnum {
    CAPITAL(1,"本金"),
    INTEREST(2,"利息"),
    PENALTY(3,"罚息"),
    MANAGEMENT_FEE(4,"平台管理费"),
    GUARANTEE_FEE(5,"担保服务费"),
    CONSULTING_FEE(6,"咨询服务费"),
    BEFORE_SEEK_ADVICE_SERVICE_FEE(7,"前置服务费"),
    BEFORE_SEEK_MANAGEMENT_FEE(8,"前置平台管理费");

    private Integer value;
    private String desc;

    public static FeeTypeEnum enumOf(Integer feeType){
        for (FeeTypeEnum feeTypeEnum : FeeTypeEnum.values()) {
            if(feeTypeEnum.getValue().equals(feeType)){
                return feeTypeEnum;
            }
        }
        throw new NoSuchElementException("FeeTypeEnum:" + feeType);
    }
}

